All,
I am trying to craete baseline set for a group of modules. This code first time works for me, But when i use the existing baseline definitions to create a another version with the same set of module it throws error: Baseline already exists in the Baseline set
Please find the attached code below. Anyhelp towards this is much appreciated.
Folder projectFolder = folder("/NA")
current = projectFolder
BaselineSetDefinition newBSD
BaselineSet BS
string bsdName = "NA - BSD"
string bsdDesc = "All modules in this folder"
string errmess = null
string currentBSD = null
Skip BLSList = create
string moduleList[] = {"/NA/Product Description",
"/NA/Base-Option System Functional Specification",
"",
""}
for newBSD in projectFolder do
currentBSD = name(newBSD)
if(currentBSD == null)
{
print "Creating new BSD \n"
errmess = create(projectFolder, bsdName, bsdDesc, newBSD)
if (!null errmess)
errorBox "Unable to create a new Baseline Set Definition: " errmess
errmess = lock(newBSD)
if (!null errmess)
errorBox "Cannot lock new Baseline Set Definition: " errmess
for i in 0:1 do
{
ModName_ mod = module(moduleList[i])
put(BLSList,i,mod)
errmess = addModule(mod, newBSD)
if (!null errmess)
{
//errorBox "Could not add module " name(mod) ": " errmess
}
}
errmess = save(newBSD)
unlock(newBSD)
string BSRef = create(newBSD, true,"", "Dont Know",BS)
string addtoBaseline = addBaselines(BLSList, BS)
close (BS)
//BS = null
}
else
{
//BaselineSet BS = null
//unlock(newBSD)
print "BSD exists \n"
string BSRef = create(newBSD, true,"", "Dont",BS)
//print BSRef "\n"
string addtoBaseline = addBaselines(BLSList, BS)
print addtoBaseline "\n"
close (BS)
}
SystemAdmin - Mon Sep 07 07:35:37 EDT 2009 |